/**
 * 判断值是否为空
 * @param {*} val
 */
 const isEmpty = (val) => {
  if ("" == val || undefined == val || null == val) {
    return true;
  }
  return false;
};
/**
 * 格式化时间 将时间格式数据转为  => 2021-08-31
 * @param {*} time
*/
const FormatDate = (time) => {
  if ("" == time || undefined == time || null == time) {
    return "";
  }
  var date = new Date(time);
  var Y = date.getFullYear();
  var m = date.getMonth() + 1;
  if (m < 10) {
    m = "0" + m;
  }
  var d = date.getDate();
  if (d < 10) {
    d = "0" + d;
  }
  var h = date.getHours();
  if (h < 10) {
    h = "0" + h;
  }
  var i = date.getMinutes();
  if (i < 10) {
    i = "0" + i;
  }
  var s = date.getSeconds();
  if (s < 10) {
    s = "0" + s;
  }
  return Y + '-' + m + '-' + d + ' ' + h + ':' + i + ':' + s;
};
export default {
  isEmpty,
  FormatDate
};
